package day12.task;

import java.util.Scanner;

public class TaskFive {
    private int age;

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        try {
            if(age<=100&&age>=1){
            this.age = age;
            System.out.println(this.age);}else {
                throw new IndexOutOfBoundsException("年龄必须在1到100之间");
            }
        }catch (IndexOutOfBoundsException e){
            e.printStackTrace();
        }

    }
}
class Main{
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        TaskFive p=new TaskFive();
        p.setAge(sc.nextInt());
    }
}
